<template>
  <div>
    <form @submit="fn">
      <input type="text" name="username" v-model.trim="form.username" />

      <input type="text" name="password" v-model.lazy="form.password" />

      <button>提交</button>
    </form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: '杭州的第一场雪',

      form: {
        username: '',
        password: '',
        flag: true
      }
    }
  },

  methods: {
    fn(e) {
      e.preventDefault()
      console.log(this.form.username)
      console.log(this.form.password)
    }
  }
}
</script>

<style scoped></style>
